package com.sist.ocs.component;

import com.sist.ocs.model.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyReceive {

    @RabbitListener(queues = "myDirectQue")
    public void process(User msg) {
        System.out.println(new Date() + " : " + msg);
    }

    @RabbitListener(queues = "mytopicQue")
    public void precess2(User user) {
        System.out.println(new Date() + " : " + user);
    }

    @RabbitListener(queues = "myfanoutQueA")
    public void precess3(User user) {
        System.out.println("Fanout Ex--> Queue A receive : " + user);
    }

    @RabbitListener(queues = "myfanoutQueB")
    public void precess4(User user) {
        System.out.println("Fanout Ex--> Queue B receive : " + user);
    }

    @RabbitListener(queues = "myDirectConfQue")
    public void precess5(User user) {
        System.out.println("Direct Ex--> Queue confirm receive : " + user);
    }

}
